package ru.st.selenium.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class AllFilmPage extends InternalPage{
	
	public AllFilmPage(PageManager pages) {
		super(pages);
	}

	@FindBy(id = "q")
	public WebElement searchFilmLine;
		
	@FindBy(name = "title")
    public WebElement TitleFilm;
	
	public AllFilmPage sendSearchFilmLine() {
		searchFilmLine.sendKeys("text"+ Keys.RETURN);
		    return this;
	}
	
	public AllFilmPage clickTitleFilm() {
		TitleFilm.click();
	    return this;
  }

	
	public AllFilmPage ensurePageLoaded() {
		    super.ensurePageLoaded();
		    wait.until(presenceOfElementLocated(By.id("q")));
		    return this;
	}
	
}
